package com.lin.controller;

import com.lin.pojo.MDesignProcedure;
import com.lin.pojo.PageVo;
import com.lin.pojo.SCell;
import com.lin.service.SCellService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
public class SCellController {
    @Autowired
    SCellService sCellService;
    @GetMapping("/scell.action")
    public PageVo<SCell> querySCellbycond(SCell sCell,
                                                @RequestParam(value = "pagenum",defaultValue = "1") Integer pageno,
                                                @RequestParam(value = "pagesize",defaultValue = "8") Integer pagesize){
        return sCellService.querySCellbycond(sCell,pageno,pagesize);
    }
    @GetMapping("/querySCellbycondwangyingliang.action")
    public PageVo<SCell> querySCellbycondwangyingliang(SCell sCell,
                                          @RequestParam(value = "pageno",defaultValue = "1") Integer pageno,
                                          @RequestParam(value = "pagesize",defaultValue = "5") Integer pagesize){
        System.out.println("6666666666666666"+sCell);
        return sCellService.querySCellbycondwangyingliang(sCell,pageno,pagesize);
    }
    @GetMapping("/querySCellbyid.action/{id}")
    public SCell querySCellbyid(@PathVariable int id) {
        return sCellService.querySCellbyid(id);
    }
    @PostMapping("/addSCell.action")
    public Map addSCell(SCell sCell){
        System.out.println("2222222222222222"+sCell);
        return sCellService.addSCell(sCell);
    }
    @RequestMapping("/upSCell.action")
    public Map upSCell(SCell sCell) {
        return sCellService.upSCell(sCell);
    }
    @RequestMapping("/upSCellcome.action")
    public Map upSCellcome(SCell sCell) {
        return sCellService.upSCell01(sCell);
    }
    @GetMapping("/queryfifstkindscellname.action")
    public List<SCell> queryfifstkindscellname(){
        return sCellService.queryfifstkindscellname();
    }
}
